<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2017/5/11
 * Time: 23:51
 */
namespace app\pc\validate;

use think\Validate;


class NpValidate extends Validate
{

    protected $rule = [
        "id"=>'number|between:1,10000000000|require|checkModel',
        "name"=>"require|chsAlphaNum|min:4",
        "depart_name"=>"require",
        "user_name"=>"require|chsAlphaNum|min:2",
        "dd"=>"require|array",
        "attribute"=>"require|number|between:1,10000000000|min:1",
        "code"=>"require",
        "mcode"=>"require",
		 "stock_id"=>"require|number|between:1,10000000000",
        "capital_money"=>"require",
        "mouths"=>"require",
        "ids"=>"require",
        "idss"=>"require",
        "auto"=>"number",
        "stockid"=>"require",
        "id_card"=>["require","regex"=>"^[1-9]\d{5}(18|19|([23]\d))\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{0,3}[0-9Xx]$"],
        "real_name"=>"require|chsAlphaNum",
        "bank_name"=>"require|chsAlphaNum",
        "bank_no"=>"require|checkModel2_no",
        "account_name"=>"require|chsAlphaNum",
        "bank_config_name"=>"require|min:1|number",
        "qq"=>"number|length:6,25",
        "weixin"=>"length:4,25",
        "province"=>"require|chsAlphaNum",//期权编号
        "city"=>"require|chsAlphaNum",//期权编号
        "district"=>"require|chsAlphaNum",//期权编号
        "mobiles"=>["require","regex"=>"^\d{11}$"],//期权编号
        "transact_password"=>["require","regex"=>"\w{6,}","min"=>"6"],//期权编号
        "oldtransact_password"=>["require","regex"=>"\w{6,}","min"=>"6"],//期权编号
        "status"=>"number",//非必传
        "image"=>"require",//非必传
        "daan"=>["require","regex"=>"[ABCDEHI]{12}"],//非必传



        "sex"=>"max:20000",//非必传
        "id_type"=>"max:20000",//非必传
        "id_number"=>"max:20000",//非必传
        "citizenhood"=>"max:20000",//非必传
        "zhiye"=>"max:20000",//非必传
        "zhiwu"=>"max:20000",//非必传
        "lianxifangshi"=>"max:20000",//非必传
        "zuoji"=>"max:20000",//非必传
        "yidongdianhua"=>"max:20000",//非必传
        "youbian"=>"max:20000",//非必传
        "dianziyouxiang"=>"max:20000",//非必传
        "zhuzhi"=>"max:20000",//非必传
        "zicguimo1"=>"max:20000",//非必传
        "zicguimo2"=>"max:20000",//非必传
        "touzhijingli"=>"max:20000",//非必传
        "touzhijingli2"=>"max:20000",//非必传
        "jiaoyishouyiren"=>"max:20000",//非必传
        "buliang"=>"max:20000",//非必传
        "qianzi"=>"max:20000",//非必传
        "orientation"=>"in:0,1|length:1",//非必传


    ];
    //"banksave"=>["bank_name","bank_no","account_name","bank_config_name"],

    protected $message  =   [
        "name"=>"名称",

        "user_name"=>"用户名称",

        "attribute"=>"属性",
        "code"=>"验证码",
        "mcode"=>"验证码",
        "stock_id"=>"股票主键",
        "capital_money"=>"名义本金",
        "mouths"=>"成交月份",
        "ids"=>"require",
        "idss"=>"require",
        "auto"=>"是否自动",
        "stockid"=>"require",
        "id_card"=>"身份证",
        "real_name"=>"真名",
        "bank_name"=>"银行名称",
        "bank_no"=>"银行号码",
        "account_name"=>"账户名",
        "bank_config_name"=>"所属银行",
        "qq"=>"number|length:6,25",
        "weixin"=>"length:4,25",
        "province"=>"省份",//期权编号
        "city"=>"城市",//期权编号
        "district"=>"区",//期权编号
        "mobiles"=>"手机号码",//期权编号
        "transact_password"=>"交易密码",//期权编号
        "oldtransact_password"=>"旧交易密码",//期权编号
        "status"=>"状态",//非必传
        "image"=>"上传文件",//非必传
        "daan"=>"答案",//非必传
        "sex"=>"性别",//非必传
        "id_type"=>"证件类型",//非必传
        "id_number"=>"证件号码",//非必传
        "citizenhood"=>"max:20000",//非必传
        "zhiye"=>"职业",//非必传
        "zhiwu"=>"职务",//非必传
        "lianxifangshi"=>"联系方式",//非必传
        "zuoji"=>"座机",//非必传
        "yidongdianhua"=>"移动电话",//非必传
        "youbian"=>"邮编",//非必传
        "dianziyouxiang"=>"电子邮箱",//非必传
        "zhuzhi"=>"住址",//非必传
        "zicguimo1"=>"资产规模",//非必传
        "zicguimo2"=>"资产规模",//非必传
        "touzhijingli"=>"投资经历",//非必传
        "touzhijingli2"=>"投资经历",//非必传
        "jiaoyishouyiren"=>"max:20000",//非必传
        "buliang"=>"不良诚信记录",//非必传
        "qianzi"=>"max:20000",//非必传
        "orientation"=>"方向",//非必传
    ];

    protected $scene = [
        'sharesaddshare'   =>  ["attribute","name","code"],
        'sharessearchget'   =>  ["id"],
		"enquirysave"=>["stock_id","capital_money","mouths","auto"],
		"enquirydetails"=>["id"],
		"sharessearch"=>["code"],
		"enquiryoneclick"=>["ids"],
		"usersoptionalstockaddstock"=>["stockid"],
		"usersoptionalstockdelete"=>["id"],
		"bankidentification"=>["id_card","real_name"],
		"bankrecharge"=>["deposit","bank_id"],//充值金额 银行卡id
		"orderdetailsindex"=>["status"],
		"orderdetailsrevokeapply"=>["id"],
		"orderdetailsread"=>["id"],
		"orderdetailssellapplymany"=>["ids"],
		"moneysetpassword"=>["transact_password","code","mcode"],
		"moneyrecharge"=>["deposit","auto"],
		"zipinf"=>["daan"],
		"moneywithdraw"=>["transact_password","deposit","bank_id"],
		"moneychangepassword"=>["transact_password","oldtransact_password"],
		"banksave"=>["bank_name","bank_no","account_name","bank_config_name","province","city","district","mobiles"],

        "zisave"=>["user_name","sex","id_type","id_number","citizenhood","zhiye","zhiwu","lianxifangshi","zuoji","yidongdianhua","youbian","dianziyouxiang","zhuzhi","zicguimo1",
            "zicguimo2",
            "touzhijingli",
            "touzhijingli2",
            "jiaoyishouyiren",
            "buliang",
            "qianzi",
            ],
        "ziaddimage"=>['image'],
        "ziaddimagehz"=>['image'],
        "protocolread"=>['idss'],
        "informationread"=>['id'],


        /**
         *  PC 端
         */
        "pcaccountpositive"=>["orientation"]

    ];

}